package com.szt.mobile.inventory.common.entity;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.szt.mobile.inventory.common.entity.Assets;
import com.szt.mobile.inventory.common.entity.Inventory;
import com.szt.mobile.inventory.common.entity.Account;
import com.szt.mobile.inventory.common.entity.AssetsList;

import com.szt.mobile.inventory.common.entity.AssetsDao;
import com.szt.mobile.inventory.common.entity.InventoryDao;
import com.szt.mobile.inventory.common.entity.AccountDao;
import com.szt.mobile.inventory.common.entity.AssetsListDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig assetsDaoConfig;
    private final DaoConfig inventoryDaoConfig;
    private final DaoConfig accountDaoConfig;
    private final DaoConfig assetsListDaoConfig;

    private final AssetsDao assetsDao;
    private final InventoryDao inventoryDao;
    private final AccountDao accountDao;
    private final AssetsListDao assetsListDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        assetsDaoConfig = daoConfigMap.get(AssetsDao.class).clone();
        assetsDaoConfig.initIdentityScope(type);

        inventoryDaoConfig = daoConfigMap.get(InventoryDao.class).clone();
        inventoryDaoConfig.initIdentityScope(type);

        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
        accountDaoConfig.initIdentityScope(type);

        assetsListDaoConfig = daoConfigMap.get(AssetsListDao.class).clone();
        assetsListDaoConfig.initIdentityScope(type);

        assetsDao = new AssetsDao(assetsDaoConfig, this);
        inventoryDao = new InventoryDao(inventoryDaoConfig, this);
        accountDao = new AccountDao(accountDaoConfig, this);
        assetsListDao = new AssetsListDao(assetsListDaoConfig, this);

        registerDao(Assets.class, assetsDao);
        registerDao(Inventory.class, inventoryDao);
        registerDao(Account.class, accountDao);
        registerDao(AssetsList.class, assetsListDao);
    }
    
    public void clear() {
        assetsDaoConfig.clearIdentityScope();
        inventoryDaoConfig.clearIdentityScope();
        accountDaoConfig.clearIdentityScope();
        assetsListDaoConfig.clearIdentityScope();
    }

    public AssetsDao getAssetsDao() {
        return assetsDao;
    }

    public InventoryDao getInventoryDao() {
        return inventoryDao;
    }

    public AccountDao getAccountDao() {
        return accountDao;
    }

    public AssetsListDao getAssetsListDao() {
        return assetsListDao;
    }

}
